import pyautogui as g
import time
import sys
g.PAUSE=1
w,h=g.size()
wm,wh=g.position()
if w>=wm and h>=wh:
    pass
else:
    print('\033[30;43m[warn]\033[0m当前有多个屏幕，程序只能运行在主屏') 
# print('[info]请在3秒后将运行...',end=' ')
# sys.stdout.flush()
# for i in range(1,4):
#     print(i,end=' ')
#     sys.stdout.flush()
#     time.sleep(1)
# wm,wh=g.position()
# print('[info]请放开鼠标，让他自由活动')
# time.sleep(1)
# g.click(499,881)
g.screenshot(r'C:\Users\lixuecheng\Envs\testautoui\autoui\pic\3.png',region=(0,80,520,990))
# z=g.locateCenterOnScreen(r'C:\Users\lixuecheng\Envs\testautoui\autoui\pic\2.jpg')
# z=g.locateOnScreen(image=r'C:\Users\lixuecheng\Envs\testautoui\autoui\pic\1.png',grayscale=True)
# print(z)  





# print(g.position())
# time.sleep(4)
# print(g.position())